DIRCROSSCOMPILER = src/cross-compiler
DIRPRECOMPILER = src/pre-compiler
DIRSIMULATOR = src/simulateur
SUBDIRS = src/cross-compiler src/pre-compiler src/simulateur
.PHONY: subdirs $(SUBDIRS)

all: compileeverything

compileeverything: subdirs
	@for dir in $(SUBDIRS); do \
		mv $$dir/*.exe bin/; \
	done

subdirs: $(SUBDIRS)

$(SUBDIRS):
	@$(MAKE) -C $@


clean:
	@for dir in $(SUBDIRS); do \
		$(MAKE) clean -C $$dir; \
	done

mrproper:
	@for dir in $(SUBDIRS); do \
		$(MAKE) clean -C $$dir; \
	done
	@rm bin/*.exe bin/*.asm bin/*.rom

dumpROM:
	@xxd -u -c 4 -g 1 bin/prog.rom
